package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@LagouController
@LagouRequestMapping("/demo2")
@Security({"zhang3", "li4"})
public class Demo2Controller {


    @LagouAutowired
    private IDemoService demoService;


    /**
     * URL: /demo/query
     * @param request
     * @param response
     * @param name
     * @return
     */
    @LagouRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response) throws IOException {
//        response.getWriter().print("Hello," + name);
        return "这是查询/demo2/query的实际内容";
    }

    @LagouRequestMapping("/query2")
    @Security({"zhang3"})
    public String query2(HttpServletRequest request, HttpServletResponse response) throws IOException {
//        response.getWriter().print("Hello," + name);
        return "这是查询/demo2/query2的实际内容";
    }

    @LagouRequestMapping("/query3")
    @Security({"li4", "wang5"})
    public String query3(HttpServletRequest request, HttpServletResponse response) throws IOException {
//        response.getWriter().print("Hello," + name);
        return "这是查询/demo2/query3的实际内容";
    }
}
